package com.itheima.学生工具类;

import java.util.ArrayList;

public class StudentTest {
    public static void main(String[] args) {
        //创建一个集合来存储学生对象
        ArrayList<Student> students = new ArrayList<Student>();
        //创建三个学生对象
        Student s1 = new Student("张三", 18, '男');
        Student s2 = new Student("李四", 20, '女');
        Student s3 = new Student("王五", 19, '男');
        //将学生对象添加到集合中
        students.add(s1);
        students.add(s2);
        students.add(s3);
        //调用工具类中的方法，获取最大学生的年龄
        int maxAge = StudentUtil.getMaxAgeStudent(students);
        System.out.println(maxAge);
    }
}
